﻿#ifndef AUDIOQUEUE_H
#define AUDIOQUEUE_H

#include "FrameQueue.h"

class AudioQueue : public FrameQueue
{
public:
    AudioQueue(int maxCapacity, int sampleRate, int channels);
    bool isFull() override;

private:
     int calculateFrameSamples(AVFrame* frame);

    int maxCapacity; // 最大容量，单位为采样数
    int sampleRate; // 采样率
    int channels; // 通道数
    int currentSamples; // 当前队列中的总采样数

protected:
    void onFramePushed(AVFrame *frame) override;
    void onFramePoped(AVFrame *frame) override;
};


#endif // AUDIOQUEUE_H
